<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div>
        123
    </div>
    <script>
        //获取事件源
        let div = document.querySelector('div')
        //事件类型
        div.onclick = function () {
            console.log('我被选中了')
        }
//事件处理

    </script>
</body>

</html>